package com.weitu.permission.user.entity;

import java.io.Serializable;

/**
 * Table: SYS_USER_DEPARTMENT
 */
public class UserDepartment implements Serializable {
    /**
     * Column: SYS_USER_DEPARTMENT.userId
     */
    private String userId;

    /**
     * Column: SYS_USER_DEPARTMENT.deptId
     */
    private String deptId;

    /**
     * Column: deptName
     */
    private String deptName;

    private static final long serialVersionUID = 1L;

    public UserDepartment() {
    }

    public UserDepartment(String userId, String deptId) {
        this.userId = userId;
        this.deptId = deptId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId == null ? null : userId.trim();
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId == null ? null : deptId.trim();
    }

    public String getDeptName() {
        return deptName;
    }

    public void setDeptName(String deptName) {
        this.deptName = deptName;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("UserDepartment{");
        sb.append("userId='").append(userId).append('\'');
        sb.append(", deptId='").append(deptId).append('\'');
        sb.append(", deptName='").append(deptName).append('\'');
        sb.append('}');
        return sb.toString();
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        UserDepartment that = (UserDepartment) o;

        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;
        if (deptId != null ? !deptId.equals(that.deptId) : that.deptId != null) return false;
        return deptName != null ? deptName.equals(that.deptName) : that.deptName == null;
    }

    @Override
    public int hashCode() {
        int result = userId != null ? userId.hashCode() : 0;
        result = 31 * result + (deptId != null ? deptId.hashCode() : 0);
        result = 31 * result + (deptName != null ? deptName.hashCode() : 0);
        return result;
    }

}